package com.lyf.jvm.learn.atsgg.memeorygc;

/**
 * -XX:+PrintGCDetails is deprecated. Will use -Xlog:gc* instead.
 * --显示查看GC的内存情况--
 * @author LYF
 * @date 2022/7/14
 */
public class LocalVariableGCTests {
    public void test1(){
        byte[] bytes = new byte[1024];
        System.gc();
    }
    public void test2(){
        byte[] bytes = new byte[1024];
        bytes = null;
        System.gc();
    }
    public void test3(){
        {
            byte[] bytes = new byte[1024];
        }
        System.gc();
    }
    public void test4(){
        {
            byte[] bytes = new byte[1024];
        }
        int val = 10;
        System.gc();
    }
    public void test5(){
        test1();
        System.gc();
    }
    public static void main(String[] args) {
        LocalVariableGCTests localVariableGCTests = new LocalVariableGCTests();
        localVariableGCTests.test1();
    }
    
}
